/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface MesOrderTaskRep extends BasicModel<MesOrderTaskRep> {
  taskId?: string; // 任务ID
  modid?: string; // 订单子表ID
  lineCode?: string; // 机台
  operCode?: string; // 工序编码
  invCode?: string; // 存货编码
  iqty?: number; // 加工数量
  iprice?: number; // 计件单价
  createByName?: string; // 报工人
  operator?: string; // 操作工
  createDate?: string; // 订单日期

  taskList?: any[]; // 任务列表
}

export const mesOrderTaskRepList = (params?: MesOrderTaskRep | any) =>
  defHttp.get<MesOrderTaskRep>({ url: adminPath + '/mo/rep/mesOrderTaskRep/list', params });

export const mesOrderTaskRepListData = (params?: MesOrderTaskRep | any) =>
  defHttp.post<Page<MesOrderTaskRep>>({
    url: adminPath + '/mo/rep/mesOrderTaskRep/listData',
    params,
  });

export const mesOrderTaskRepForm = (params?: MesOrderTaskRep | any) =>
  defHttp.get<MesOrderTaskRep>({ url: adminPath + '/mo/rep/mesOrderTaskRep/form', params });

export const mesOrderTaskRepSave = (params?: any, data?: MesOrderTaskRep | any) =>
  defHttp.postJson<MesOrderTaskRep>({
    url: adminPath + '/mo/rep/mesOrderTaskRep/save',
    params,
    data,
  });

export const mesOrderTaskRepDelete = (params?: MesOrderTaskRep | any) =>
  defHttp.get<MesOrderTaskRep>({ url: adminPath + '/mo/rep/mesOrderTaskRep/delete', params });

export const mesOrderTaskRep = (params?: any) =>
  defHttp.postJson<MesOrderTaskRep>({
    url: adminPath + '/mo/rep/mesOrderTaskRep/batchTaskRep',
    params,
  });
